<?php

namespace BlogBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class PublicController extends Controller
{
    /**
     * @Template("BlogBundle:Public:nav.html.twig")
     */
    public function recentNavAction($path)
    {
        $em = $this->getDoctrine()->getManager();
        $Category = $em->getRepository('BlogBundle:Category');
        $category = $Category->findOneByPath($path);
        $categories = $Category->findAll();
        return compact('category', 'categories', 'path');
    }
}
